package org.vison.wonfu.framework.commons.tools;

import org.vison.wonfu.framework.commons.utils.StringUtils;

public class Assert {
    private Assert() {
    }

    public static void notNull(Object obj, String message) {
        if (obj == null) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void notEmpty(String str, String message) {
        if (StringUtils.isEmpty(str)) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void notNull(Object obj, RuntimeException exception) {
        if (obj == null) {
            throw exception;
        }
    }

    public static void notEmpty(String str, RuntimeException exception) {
        if (StringUtils.isEmpty(str)) {
            throw exception;
        }
    }
}
